//相同symbol
const s1 = Symbol.for('foo');
const s2 = Symbol.for('foo');
console.log(s1 === s2)//true

//for方法维护的是字符串,如果不是字符串会自动转为字符串
console.log(Symbol.for(true) === Symbol.fro('true')); //true


const obj = {
  [Symbol()]: 'symbol value',
  foo: 'normal value'
}

//symbol属性会被忽略
for (var key in obj) {
  console.log(key)
}
console.log(Object.keys(obj))
console.log(JSON.stringify(obj))


//获取的全是symbol类型的属性名
console.log(Object.getOwnPropertySymbols(obj));